﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Sheep_Breeding.Domain.production_b
{
    /// <summary>
    /// 羊只采购实体类
    /// </summary>
    [Table("sheep_purchase")]
    public class SheepPurchase
    {
        /// <summary>
        /// 主键ID
        /// </summary>
        [Key]
        [Column("id")]
        public long Id { get; set; }

        /// <summary>
        /// 采购日期
        /// </summary>
        [Required]
        [Column("purchase_date")]
        public DateTime PurchaseDate { get; set; }

        /// <summary>
        /// 采购员ID
        /// </summary>
        [Required]
        [Column("purchaser_id")]
        public long PurchaserId { get; set; }

        /// <summary>
        /// 羊只类型ID
        /// </summary>
        [Column("sheep_type_id")]
        public long? SheepTypeId { get; set; }

        /// <summary>
        /// 批次号/耳号
        /// </summary>
        [Column("batch_number")]
        [StringLength(100)]
        public string BatchNumber { get; set; } = string.Empty;

        /// <summary>
        ///栋舍ID
        /// </summary>
        [Column("pen_id")]
        public long? PenId { get; set; }

        /// <summary>
        /// 性别
        /// </summary>
        [Column("gender")]
        [StringLength(10)]
        public string Gender { get; set; } = string.Empty;

        /// <summary>
        /// 标签
        /// </summary>
        [Column("tag")]
        [StringLength(200)]
        public string Tag { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位
        /// </summary>
        [Column("unit")]
        [StringLength(20)]
        public string Unit { get; set; } = string.Empty;

        /// <summary>
        /// 入库数量
        /// </summary>
        [Column("quantity")]
        public int? Quantity { get; set; }

        /// <summary>
        /// 只均单价
        /// </summary>
        [Column("unit_price")]
        public decimal? UnitPrice { get; set; }

        /// <summary>
        /// 金额
        /// </summary>
        [Column("amount")]
        public decimal? Amount { get; set; }

        /// <summary>
        /// 单位折扣
        /// </summary>
        [Column("discount")]
        public decimal? Discount { get; set; }

        /// <summary>
        /// 调整金额
        /// </summary>
        [Column("adjustment")]
        public decimal? Adjustment { get; set; }

        /// <summary>
        /// 结算金额
        /// </summary>
        [Column("final_amount")]
        public decimal? FinalAmount { get; set; }

        /// <summary>
        /// 总重量
        /// </summary>
        [Column("total_weight")]
        public decimal? TotalWeight { get; set; }

        /// <summary>
        /// 核算单元ID
        /// </summary>
        [Column("accounting_unit_id")]
        public long? AccountingUnitId { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        [Column("summary")]
        [StringLength(500)]
        public string Summary { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        [Column("remark")]
        [StringLength(1000)]
        public string Remark { get; set; } = string.Empty;

        /// <summary>
        /// 创建人
        /// </summary>
        [Column("create_user_id")]
        public string? CreateUserId { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Required]
        [Column("create_time")]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 修改人
        /// </summary>
        [Column("update_user_id")]
        public string? UpdateUserId { get; set; }

        /// <summary>
        /// 修改时间
        /// </summary>
        [Column("update_time")]
        public DateTime? UpdateTime { get; set; }

        /// <summary>
        /// 审核人
        /// </summary>
        [Column("approval_user_id")]
        public string? ApprovalUserId { get; set; }

        /// <summary>
        /// 审核时间
        /// </summary>
        [Column("approval_time")]
        public DateTime? ApprovalTime { get; set; }

        /// <summary>
        /// 逻辑删除
        /// </summary>
        [Column("is_dele")]
        public bool IsDele { get; set; } = false;
    }
}
